-
Notifications
You must be signed in to change notification settings - Fork 24
DOCSP-45007: Distinct #292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for mongodb-docs-csharp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! One comment but awesome job overall
|
||
{ | ||
// start-distinct | ||
var results = collection.Distinct<string>("borough", new BsonDocument()).ToList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not clear to the reader what new BsonDocument()
is doing here.
I had to reverse engineer what it was: a filter
that matches all documents.
As alternative to new BsonDocument()
might be Builders<Restaurant>.Filters.Empty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might also be worth showing the type safe version:
collection.Distinct(x => x.Borough, x => true)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made tweaks for the next version!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(cherry picked from commit 341fcf8)
(cherry picked from commit 341fcf8)
(cherry picked from commit 341fcf8)
(cherry picked from commit 341fcf8)
(cherry picked from commit 341fcf8)
(cherry picked from commit 341fcf8)
(cherry picked from commit 341fcf8)
(cherry picked from commit 341fcf8)
(cherry picked from commit 341fcf8)
(cherry picked from commit 341fcf8)
Pull Request Info
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-45007
Staging Links
Self-Review Checklist